package com.mf.ergate.api.sys;

import com.mf.ergate.api.ApiConfig;
import com.mf.ergate.api.sys.model.dto.*;
import com.mf.ergate.api.sys.model.vo.FileStorageInfoVo;
import com.mf.framework.common.model.Page;
import com.mf.framework.common.model.RemotePage;
import com.mf.framework.common.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 文件存储信息RemoteService层接口类
 * User: zhaoming
 * DateTime: 2019-03-11
 * To change this template use File | Settings | File Templates.
 **/
@Api(value = "/api/fileStorageInfo", tags = "FileStorageInfoController", description = "文件存储信息服务")
@FeignClient(name= ApiConfig.SERVICE_NAME)
@RequestMapping("/api/fileStorageInfo")
public interface FileStorageInfoRemoteService{

    /**
     * 保存
     * @param fileStorageInfoSaveDto 文件存储信息新增Dto
     * @return 文件存储信息
     */
    @ApiOperation(value = "保存")
    @ApiImplicitParam(name = "fileStorageInfoSaveDto", value = "文件存储信息保存Dto", dataType = "FileStorageInfoSaveDto",  required = true, paramType = "body")
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    Result<FileStorageInfoVo> save(@RequestBody FileStorageInfoSaveDto fileStorageInfoSaveDto);


    /**
     * 删除(逻辑删除)
     * @param fileStorageInfoDeleteDto 文件存储信息删除Dto
     * @return 执行结果
     */
    @ApiOperation(value = "根据唯一编号删除(逻辑删除)")
    @ApiImplicitParam(name = "fileStorageInfoDeleteDto", value = "文件存储信息删除Dto", dataType = "FileStorageInfoDeleteDto",  required = true, paramType = "body")
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    Result<Boolean> delete(@RequestBody FileStorageInfoDeleteDto fileStorageInfoDeleteDto);

    /**
     * 根据唯一编号查询
     * @param uniqueNo 唯一编号
     * @return 文件存储信息
     */
    @ApiOperation(value = "根据唯一编号查询")
    @ApiImplicitParam(name = "uniqueNo", value = "唯一编号", dataType = "String",  required = true, paramType = "body")
    @RequestMapping(value = "/selectByUniqueNo", method = RequestMethod.POST)
    Result<FileStorageInfoVo> selectByUniqueNo(@RequestBody String uniqueNo);

    /**
     * 根据条件分页查询
     * @param remotePage 远程分页
     * @return 文件存储信息分页列表
     */
    @ApiOperation(value = "根据条件分页查询")
    @ApiImplicitParam(name = "remotePage", value = "远程分页", dataType = "RemotePage",  required = true, paramType = "body")
    @RequestMapping(value = "/selectPage", method = {RequestMethod.POST})
    Result<Page<FileStorageInfoVo>> selectPage(@RequestBody RemotePage<FileStorageInfoQueryDto> remotePage);

    /**
     * 下载
     * @param uniqueNo 唯一编号
     * @return 文件
     */
    @ApiOperation(value = "下载")
    @ApiImplicitParam(name = "uniqueNo", value = "唯一编号", dataType = "String",  required = true, paramType = "body")
    @RequestMapping(value = "/download", method = {RequestMethod.POST})
    Result<byte[]> download(@RequestBody String uniqueNo);
}
